package com.objectproject.main.dao;

import java.util.ArrayList;

import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.objectproject.main.dao.iface.MyLocaleDAO;
import com.objectproject.main.dao.mybatis.mapper.MyLocaleMapper;
import com.objectproject.main.model.MyLocale;

@Repository
public class MyLocaleDAOImpl implements MyLocaleDAO {
	
	@Autowired
	SqlSession sqlSession;

	
	
	@Override
	public ArrayList<MyLocale> getAllMyLocales() {
		return sqlSession.getMapper(MyLocaleMapper.class).getAllMyLocales();
	}
	
	@Override
	public ArrayList<MyLocale> getAllValidMyLocales() {
		return sqlSession.getMapper(MyLocaleMapper.class).getAllValidMyLocales();
	}
	
	@Override
	public MyLocale getMyLocaleById(int localeId) {
		return sqlSession.getMapper(MyLocaleMapper.class).getMyLocaleById(localeId);
		
	}

	@Override
	public MyLocale getMyLocaleByString(String localeString) {
		return sqlSession.getMapper(MyLocaleMapper.class).getMyLocaleByString(localeString);
	}

	@Override
	public long insertMyLocale(MyLocale myLocale) {
		sqlSession.getMapper(MyLocaleMapper.class).insertMyLocale(myLocale);
		return myLocale.getLocaleId();
	}

	@Override
	public void deleteMyLocale(MyLocale myLocale) {
		// TODO Auto-generated method stub

	}

	@Override
	public void deleteMyLocaleById(int localeId) {
		// TODO Auto-generated method stub

	}

	

}
